/**
 * 匹配URL参数
 */
export function getParamsFromURL(url = window.location.href) {
	let paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
	let result = {};
	for (let i = 0; i < paraString.length; i++) {
		let j = paraString[i];
		result[j.substring(0, j.indexOf("="))] = j.substring(
			j.indexOf("=") + 1,
			j.length
		);
	}
	return result;
}

/**
 * 打开详情链接
 */
export function openNativeWindow(url) {
	const t = Date.now();
	window.prompt(
		"",
		`up://["open.zx-info-list",${t},{"url":"${url}","callbackId":${t}}]`
	);
}
